Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

270
Visualizações
Why this code is showing "error: label at end of compound statement"?

I wanted to check by placing default anywhere in the switch. It should print the default printf statement as no case label is matching & after that default case is checked in the switch. But it's showing the above error.

#include <stdio.h>

int main(void) {
    // your code goes here
    char ch='g';
    switch(ch){
        default: printf("Success!\n");
        case 'v':
        case 'h':
    }
    return 0;
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try putting break; after the case statements.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda